Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify run_dft_opt function to return hessian and frequencies #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Leticia-maria
Copy link
Collaborator

TODO:

  • Add a function that corrects imaginary (negative frequencies)
  • Add tests

@bruno-ecl As of now, I have added the functionality to the run_dft_opt function, would we rather have a separate function instead or do you think the way it is right now works?

I added to the run_dft_opt because the good practice in computational chemistry is to proceed with frequency calculations after you optimize the geometry, so I thought it would be nice to have it already embedded with geometry optimization, which does mean that I could not have it as a separate function tho. 😄

@Leticia-maria
Copy link
Collaborator Author

This PR addresses #21 and #23

@Leticia-maria
Copy link
Collaborator Author

  • As per @yiwenwang47 said, frequency calculations will be optional and requested by the user. (I will just add it into a separate function)

import numpy as np
from pyscf.dft import RKS, UKS
from pyscf.geomopt.berny_solver import optimize as berny_opt
from pyscf.geomopt.geometric_solver import optimize as geomeTRIC_opt
from pyscf.hessian import Hessian
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting an import error from this line. Shouldn't it be

from pyscf.hessian.rhf import Hessian

?

# Frequency and Hessian calculation
hessian_calculator = Hessian(calc)
hessian_matrix = hessian_calculator.kernel()
frequencies = hessian_calculator.frequencies()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is also triggering an exception:

AttributeError: 'Hessian' object has no attribute 'frequencies'

)
hessian=hessian_matrix,
frequencies=frequencies,
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The StructureRelaxationResponse doesn't have these two properties:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants